package personal.vivian.logic;

import personal.vivian.dto.Employee;
import personal.vivian.dto.Executives;
import personal.vivian.interf.Operation;

import java.math.BigDecimal;

public class DataLogic {
    public static void printThings(Employee employee) {
        employee.raise(new BigDecimal(10.0));
    }
    public static void main(String[] args) {
        printThings(new Employee());
        printThings(new Executives());
    }
    public Integer sumEven(int n) {
        Integer sum=0;
        for(int i=1;i<=n;i++){
            if(i%2==0){
                sum+=i;
            }
        }
        return sum;
    }
    public Integer timesEven(int n) {
        Integer sum=1;
        for(int i=1;i<=n;i++){
            if(i%2==0){
                sum*=i;
            }
        }
        return sum;
    }
    public Integer Even(int n,Operation operation) {
        Integer sum=0;
        Integer apply=0;
        for(int i=1;i<=n;i++){
            if(i%2==0){
                sum = operation.apply(sum,i);
            }
        }
        return sum;
    }
}
